package com.aphrodite.io.sip.header;

import com.aphrodite.io.sip.provider.SipParser;

/** SIP Header Content-Type */
public final class ContentTypeHeader extends ParametricHeader {
	// public ContentTypeHeader()
	// { super(SipHeaders.Content_Type);
	// }

	public ContentTypeHeader(Header hd) {
		super(hd);
	}

	public ContentTypeHeader(String hvalue) {
		super(SipHeaders.Content_Type, hvalue);
	}

	/** Gets content-length of ContentLengthHeader */
	public String getContentType() {
		String str;
		int end = (new SipParser(value)).indexOf(';');
		if (end < 0)
			str = value;
		else
			str = value.substring(0, end);
		return (new SipParser(str)).getString();
	}

	/** Sets content-length of ContentLengthHeader */
	public void setContentType(String cType) {
		value = cType;
	}

}
